package com.bush.mall.member.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.member.entity.MemberLoginLogEntity;
import com.bush.mall.member.service.MemberLoginLogService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 会员登录记录
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("memberloginlog")
@Api(tags = "会员登录记录管理" )
public class MemberLoginLogController {

    @Resource(name= MemberLoginLogService.BEAN_ID)
    private MemberLoginLogService memberLoginLogService;

    /**
     * 分页查询会员登录记录列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询会员登录记录列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return memberLoginLogService.queryForPage(current,size);
    }

    /**
     * 保存会员登录记录表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存会员登录记录表单")
    @PostMapping
    public Result saveMemberLoginLog(@RequestBody MemberLoginLogEntity memberLoginLog){
        return memberLoginLogService.saveMemberLoginLog(memberLoginLog);
    }

    /**
     * 修改会员登录记录表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改会员登录记录表单")
    @PutMapping
    public Result updateMemberLoginLog(@RequestBody MemberLoginLogEntity memberLoginLog){
        return memberLoginLogService.updateMemberLoginLog(memberLoginLog);
    }

    /**
     * 通过指定id删除会员登录记录
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除会员登录记录")
    @DeleteMapping
    public Result deleteMemberLoginLog(Long id){
        return memberLoginLogService.deleteMemberLoginLog(id);
    }

}
